package orbito.physics.collision;

import orbito.util.Vec2;

public interface CollisionResponse {
	
	/**
	 * Pre-emptive response to an imminent collision between two objects a and b.
	 * 
	 * In this collision response, the objects are about to collide, and the response should be 
	 * implemented in such a way that the resulting changes will prevent the collision from happening.
	 * 
	 * @param t                The current time of the simulation.
	 * @param cdt              The time until the collision occurs.
	 * @param collisionPoint   The point at which the objects are about to collide.
	 * @param a
	 * @param b
	 */
	void preemptiveResponse(double t, double cdt, Vec2 collisionPoint, CollidingBody a, CollidingBody b);
	
	/**
	 * Direct response to an existing collision between two objects a and b.
	 * 
	 * In this collision response, the objects are already intersecting, and the response should be 
	 * implemented in such a way that the resulting changes should eliminate the collision, for 
	 * example, by moving the objects out of each other.
	 * 
	 * Normally, this should not happen, as the collision manager should detect whether two objects are 
	 * about to collide. However, this case may still occur, for example, at the start of a scene where 
	 * two objects may initially start inside one another.
	 * 
	 * @param t                    The current time of the simulation.
	 * @param dt                   The current time step.
	 * @param minimumTranslation   The minimum translation vector required to translate b out of a.
	 * @param a
	 * @param b
	 */
	void directResponse(double t, double dt, Vec2 minimumTranslation, CollidingBody a, CollidingBody b);
}
